/* Layout */
import Layout from '@/layout'
// import { Message } from 'element-ui'

// 动态路由
export const asyncRoutes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    meta: { title: '首页', icon: 'nav_home' },
    children: [{
      path: 'home',
      name: 'Home',
      component: () => import('@/views/home/index'),
      meta: { title: '首页', icon: 'nav_home', noCache: true }
    }]
  },
  {
    path: '/profile',
    component: Layout,
    redirect: '/profile/index',
    hidden: true,
    children: [
      {
        path: 'index',
        component: () => import('@/views/profile/index'),
        name: 'Profile',
        meta: { title: '个人中心', icon: 'user' }
      }
    ]
  },
  {
    path: '/merchant',
    component: Layout,
    redirect: '/merchant/merchantAdmin',
    meta: { title: '商户管理', serveName: 'Shop', icon: 'nav_changguan' },
    children: [
      {
        path: 'merchantAdmin',
        name: 'MerchantAdmin',
        component: () => import('@/views/merchant/merchantAdmin/index'),
        meta: { title: '商户管理', serveName: 'ShopList' }
      },
      {
        path: 'venueAdmin',
        name: 'venueAdmin',
        component: () => import('@/views/merchant/venueAdmin'),
        meta: { title: '场馆管理', serveName: 'GymList' }
      },
      {
        path: 'merchantAdminEdit',
        name: 'MerchantAdminEdit',
        hidden: true,
        component: () => import('@/views/merchant/merchantAdmin/edit'),
        meta: { title: '新增商户', hidden: true }
      },
      {
        path: 'merchantAdminDetail',
        name: 'MerchantAdminDetail',
        hidden: true,
        component: () => import('@/views/merchant/merchantAdmin/detail'),
        meta: { title: '商户详情', hidden: true }
      }
    ]
  },
  {
    path: '/shopType',
    component: Layout,
    redirect: '/shopType/shopType',
    meta: { title: '商户类型配置', icon: 'nav_vipcard', serveName: 'ShopType' },
    children: [
      {
        path: 'ShopType',
        name: 'ShopType',
        component: () => import('@/views/merchantConfig/type'),
        meta: { title: '商户类型', serveName: 'ShopTypeList' }
      },
      {
        path: 'ShopRole',
        name: 'ShopRole',
        component: () => import('@/views/merchantConfig/role'),
        meta: { title: '商户角色', serveName: 'ShopRole' }
      },
      {
        path: 'RoleBind',
        name: 'RoleBind',
        hidden: true,
        component: () => import('@/views/merchantConfig/role/roleBind'),
        meta: { title: '分配角色' }
      },
      {
        path: 'MiniTemplate',
        name: 'MiniTemplate',
        component: () => import('@/views/merchantConfig/template'),
        meta: { title: '小程序模版', serveName: 'TempList' }
      },
      {
        path: 'MiniTemplateEdit',
        name: 'MiniTemplateEdit',
        hidden: true,
        component: () => import('@/views/merchantConfig/template/temp.vue'),
        meta: { title: '新增模板' }
      }
    ]
  },
  {
    path: '/SMS',
    component: Layout,
    redirect: '/shopType/shopType',
    meta: { title: '短信管理', serveName: 'Sms', icon: 'nav_youhuiquan' },
    children: [
      {
        path: 'SMSStatistic',
        name: 'SMSStatistic',
        component: () => import('@/views/SMS/statistics'),
        meta: { title: '短信统计', serveName: 'SmsStastics' }
      },
      {
        path: 'SMSshopAdmin',
        name: 'SMSshopAdmin',
        component: () => import('@/views/SMS/shopAdmin'),
        meta: { title: '商户短信管理', serveName: 'SmsShopList' }
      },
      {
        path: 'SMSrechargeRecord',
        name: 'SMSrechargeRecord',
        component: () => import('@/views/SMS/rechargeRecord'),
        meta: { title: '充值记录', serveName: 'SmsRechargeRecord' }
      },
      {
        path: 'SMSrechargeMeal',
        name: 'SMSrechargeMeal',
        component: () => import('@/views/SMS/rechargeMeal'),
        meta: { title: '充值套餐配置', serveName: 'SmsMealList' }
      }
    ]
  },
  {
    path: '/message',
    component: Layout,
    redirect: '/shopType/shopType',
    meta: { title: '消息通知', serveName: 'Msg', icon: 'nav_zhengce' },
    children: [
      {
        path: 'Message',
        name: 'Message',
        component: () => import('@/views/Message/index.vue'),
        meta: { title: '消息通知', serveName: 'MsgList' }
      }
    ]
  },
  {
    path: '/wxThirdParty',
    component: Layout,
    redirect: '/wxThirdParty/manage',
    meta: { title: '小程序管理', serveName: 'Applet', icon: 'nav_taocan' },
    children: [
      {
        path: 'wxThirdPartyManage',
        name: 'WxThirdPartyManage',
        component: () => import('@/views/wxThirdParty/manage/index'),
        meta: { title: '小程序管理', serveName: 'AppletList' }
      },
      {
        path: 'wxThirdPartyTakeNotes',
        name: 'WxThirdPartyTakeNotes',
        component: () => import('@/views/wxThirdParty/takeNotes/index'),
        meta: { title: '代注册管理', serveName: 'LogonList' }
      },
      {
        path: 'wxThirdPartyDaily',
        name: 'WxThirdPartyDaily',
        component: () => import('@/views/wxThirdParty/daily/index'),
        meta: { title: '小程序变更日志', serveName: 'AppLogList' }
      },
      {
        path: 'miniDetail',
        name: 'MiniDetail',
        component: () => import('@/views/wxThirdParty/manage/components/detail.vue'),
        meta: { title: '小程序详情' },
        hidden: true
      }
    ]
  },
  {
    path: '/edition',
    component: Layout,
    redirect: '/edition/manage',
    meta: { title: '版本管理', serveName: 'Version', icon: 'nav_yingyong' },
    children: [
      {
        path: 'editionyManage',
        name: 'EditionyManage',
        component: () => import('@/views/edition/manage/index'),
        meta: { title: '版本管理', serveName: 'VersionList' }
      },
      {
        path: 'editionyRelease',
        name: 'EditionyRelease',
        component: () => import('@/views/edition/release/index'),
        meta: { title: '版本发布管理', serveName: 'VersionReleList' }
      },
      {
        path: 'editionPartyDaily',
        name: 'EditionPartyDaily',
        component: () => import('@/views/edition/daily/index'),
        meta: { title: '版本发布日志', serveName: 'OperateList' }
      }
    ]
  },
  {
    path: '/Deploy',
    component: Layout,
    redirect: '/Deploy/DeployUpdGetLogList',
    meta: { title: '运维管理', icon: 'nav_zhanghao', serveName: 'Deploy' },
    children: [
      {
        path: 'DeployUpdGetLogList',
        name: 'DeployUpdGetLogList',
        component: () => import('@/views/edition/iteration'),
        meta: { title: '迭代发布', serveName: 'DeployUpdGetLogList' }
      },
      {
        path: 'GrayServers',
        name: 'GrayServers',
        component: () => import('@/views/edition/servers'),
        meta: { title: '服务器管理', serveName: 'SysServerList' }
      },
      {
        path: 'Grayscale',
        name: 'Grayscale',
        component: () => import('@/views/edition/Grayscale'),
        meta: { title: '灰度策略', serveName: 'SysGrayInfo' }
      },
      {
        path: 'TimedTask',
        name: 'TimedTask',
        component: () => import('@/views/edition/timedTask'),
        meta: { title: '定时任务' }
      },
    ]
  },
  {
    path: '/accountOptions',
    component: Layout,
    redirect: '/accountOptions/role',
    meta: { title: '账号配置', icon: 'nav_zhanghao', serveName: 'Account' },
    children: [{
      path: 'roleList',
      name: 'RoleList',
      component: () => import('@/views/system/role/roleList'),
      meta: { title: '角色列表', serveName: 'RoleList' }
    }, {
      path: 'roleBind',
      name: 'RoleBind',
      hidden: true,
      component: () => import('@/views/system/role/roleBind/index'),
      meta: { title: '分配权限', activeMenu: '/accountOptions/role/roleList' }
    },
    {
      path: 'accountList',
      name: 'AccountList',
      component: () => import('@/views/system/accountList'),
      meta: { title: '账号列表', serveName: 'UserList' }
    }]
  },
  {
    path: '/commonConfig',
    component: Layout,
    redirect: '/commonConfig/Dictionaries',
    meta: { title: '通用配置', serveName: 'Common', icon: 'nav_zhanghao' },
    children: [
      {
        path: 'Dictionaries',
        name: 'Dictionaries',
        component: () => import('@/views/commonSet'),
        meta: { title: '字典值配置', serveName: 'DicList' }
      }
    ]
  }
]
